home *** CD-ROM | disk | FTP | other *** search
- //-------------------------------------------
- // TiltedShadow.cs ⌐ 2001 by Charles Petzold
- //-------------------------------------------
- using System;
- using System.Drawing;
- using System.Drawing.Drawing2D;
- using System.Windows.Forms;
-
- class TiltedShadow: FontMenuForm
- {
- public new static void Main()
- {
- Application.Run(new TiltedShadow());
- }
- public TiltedShadow()
- {
- Text = "Sombra inclinada";
-
- strText = "Sombra";
- font = new Font("Times New Roman", 54);
- }
- protected override void DoPage(Graphics grfx, Color clr, int cx, int cy)
- {
- float fAscent = GetAscent(grfx, font);
-
- // Definir la lφnea base en 3/4 sobre el ßrea de cliente.
-
- grfx.TranslateTransform(0, 3 * cy / 4);
-
- // Guardar el estado de los grßficos.
-
- GraphicsState grfxstate = grfx.Save();
-
- // Definir el escalado e inclinaci≤n, y dibujar la sombra.
-
- grfx.MultiplyTransform(new Matrix(1, 0, -3, 3, 0, 0));
- grfx.DrawString(strText, font, Brushes.DarkGray, 0, -fAscent);
-
- // Dibujar texto sin escalado o inclinaci≤n.
-
- grfx.Restore(grfxstate);
- grfx.DrawString(strText, font, Brushes.Black, 0, -fAscent);
- }
- }
-
-